<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>管理员后台服务</title>

        <script src="./js/jquery-3.3.1.min.js"></script>
        <script src="./js/vue.js"></script>
        <link rel="stylesheet" href="./element/css/index.css">
        <script src="./element/index.js"></script>
        <script src="./js/url.js"></script>
    </head>
    <body background="./images/login.jpg" style="background-size: 100%">

        <div id="index-vue" style="box-shadow: 1px 1px 10px #c7c7c7;border-radius: 10px;width: 500px;height: 300px;
                position: absolute;left: 700px;top: 240px;">
            <span style="position: absolute;left: 40px;top: 20px;color: #c7c7c7">
                温馨提示：初始化完成后请记得到影片管理模块预热影片哦！</span>
            <button style="background-color: cyan; position: absolute;left: 150px;top: 80px;
                        width: 200px;height: 50px;font-size: 25px;border-radius: 10px;border: none;box-shadow: 1px 1px 10px whitesmoke;">
                <a style="text-decoration: none" @click="init">初始化搜索引擎</a>
            </button>
            <button v-show="initResult=='OK'" style="position: absolute;left: 150px;top: 160px;
                        width: 200px;height: 50px;font-size: 25px;border-radius: 10px;border: none;box-shadow: 1px 1px 10px whitesmoke;">
                <a style="text-decoration: none"  :href="adminUrl">管理菜单</a>
            </button>
        </div>

    <script>
        var vueapp = new Vue({
            el: "#index-vue",
            data: {
                initResult: 'OK',
                adminUrl: axios_url.adminBaseURL+"/manage/movie.html",
            },
            methods: {
                init: init
            }
        })
        function init() {
            var adminBaseURL = axios_url.adminBaseURL;
            $.get(adminBaseURL+"/admin/es/init",function (res) {
                if (res.code==200) {
                    vueapp.$message({
                        message: '引擎初始化完成！',
                        type: 'success'
                    });
                    vueapp.initResult = 'OK';
                }
            })
        }
    </script>
    </body>
</html>